﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using T_Rbac_APi.Application.Command.Quanxian;

namespace T_Rbac_APi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class QuanxianController : ControllerBase
    {
        private readonly IMediator mediator;

        public QuanxianController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 分配权限
        /// </summary>
        /// <param name="quanxianAddCommand"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<int> AddQuanxian(QuanxianAddCommand quanxianAddCommand)
        {
            return await mediator.Send(quanxianAddCommand);
        }
    }
}
